local hx__haren = fk.CreateSkill {
  name = "hx__haren",
  tags = { Skill.Compulsory, },
}


hx__haren:addEffect(fk.DamageCaused, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
      if not player:hasSkill(hx__haren.name) then return false end
      if event == fk.DamageCaused then
          return target == player and data.to
      end
  end,
  on_use = function(self, event, target, player, data)
      local x = player.hp
      if event == fk.DamageCaused then
        data.damage = x
      end
  end,
})
hx__haren:addEffect(fk.DamageInflicted, {
  anim_type = "negative",
  can_trigger = function(self, event, target, player, data)
      if not player:hasSkill(hx__haren.name) then return false end
      if event == fk.DamageInflicted then
        return target == player
      end
  end,
  on_use = function(self, event, target, player, data)
      local x = player.hp
      data.damage = x
  end,
})

return hx__haren